package com.cxg.allsys.adminsys.service.impl;

import com.cxg.allsys.adminsys.mapper.AdminMapper;
import com.cxg.allsys.adminsys.pojo.Admin;
import com.cxg.allsys.adminsys.service.IAdminService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Data
@Slf4j
public class AdminService implements IAdminService {
    @Autowired
    private AdminMapper adminMapper;
    //管理员登录
    @Override
    public boolean qure(String userName, String password) {
        log.info("service系统管理员登录==实现类");
        log.info("管理员账号："+userName+"~~~"+"管理员密码："+password);
        Admin admin = adminMapper.qure(userName); ;
        log.info(String.valueOf("输出管理员信息:"+admin));
        if(admin==null){
            return false;
        }else{
            if(admin.getPassword().equals(password)){
                return true;
            }else{
                return false;
            }
        }
    }
}
